#!/usr/bin/env python
# Author: iris and jeff

PKG = 'sound_localization'
NAME = 'sound_localization_trainer'

import roslib; roslib.load_manifest(PKG)
import rospy
import scipy as sp
import numpy as np

from sound_localization.msg import *


class SoundLocalizationTrainer():
    def __init__(self):

        # Initialize the node
        rospy.init_node(NAME, anonymous=True)

        # Subscribe to sample_collector
        rospy.Subscriber('/sound_localization/audio_location_sample', AudioLocationSample, self.callback)



    def callback(self,  data):
        try:
            
            loc = data.robot_location
            sample = data.delays_sample

        except rospy.ServiceException, e:
            print "Reply failed: %s" % e


if __name__ == '__main__':
    try:
        st = SoundLocalizationTrainer()
        rospy.spin()
    except rospy.ROSInterruptException:
        pass
